WORD Pgetuid(); WORD Pgetgid(); WORD Pgeteuid(); WORD Pgetegid();
Similarly, Pgetgid returns the real group id of the currently running process; this will also be a number between 0 and 255.
Pgeteuid and Pgetegid are similar to Pgetuid and Pgetgid respectively, except that they return the effective user or group id. This is normally the same as the real user or group id, except that if a program is run which has the set uid or set gid bit bit set, it will run with an effective user or group id equal to the owner of the program file. Access to files is based upon the effective user or group id, so the set uid (and set gid) mechanism allows users (in particular the super user) to grant permissions to other users. This mechanism also exists in the Unix(tm) operating system.